<?php

namespace App\Http\Middleware;


use App\Services\Admin\UserService;
use Closure;


class AdminMiddleware
{
    private $UserService;

    public function __construct(UserService $UserService)
    {
        $this->UserService = $UserService;
    }
    /**
     * @param $request
     * @param Closure $next
     * @return mixed
     * @throws \Exception
     */
    public function handle($request, Closure $next)
    {
//        $token = request()->header('token');
//        if(empty($token) && env('APP_ENV') == 'local'){
//            //登陆
//            $res = $this->UserService->Login(config('tmpuser'));
//            $token = $res['token'];
        //tmp           token
//            $token = '5769917316002da7ca43bc17d616a7b9';
//        }
        //校验登陆
//        $this->UserService->checkLogin($token);
        return $next($request);
    }
}

